﻿// This code is released under the BSD license.
namespace PugLib.UI.Controls
{
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Windows.Forms;

    public static class UIExtensions
    {
        public static void BindList<T>(this DataGridView input, IList<T> list)
        {
            BindingList<T> blist = new BindingList<T>(list);
            BindingSource bs = new BindingSource { DataSource = blist };
            input.DataSource = bs;
        }
    }
}